package face.pay.common.oem.server;

import face.pay.dao.OemProfitConfigInfoDao;
import face.pay.entity.OemProfitConfigInfo;
import face.pay.server.IOemProfitConfigServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OemProfitConfigServer extends IOemProfitConfigServer {

    @Autowired
    OemProfitConfigInfoDao oemProfitConfigInfoDao;

    @Override
    public OemProfitConfigInfo getOemProfitConfig(Integer oemId) {


        OemProfitConfigInfo oemProfitConfigInfo =  this.oemProfitConfigInfoDao.getByOemId(oemId);

        if(oemProfitConfigInfo==null){
            oemProfitConfigInfo = new OemProfitConfigInfo(oemId,3,"DEFAULT",0);
        }

        return oemProfitConfigInfo;
    }

}
